package br.com.ac.fatureweb.model.carga;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import br.com.ac.fatureweb.model.Carga;
import br.com.ac.fatureweb.utilitary.Model;

@Entity
@Table(name = "ECONOMIA")
@SequenceGenerator(name = "SEQ_ECONOMIA", sequenceName = "SEQ_ECONOMIA", allocationSize = 1, initialValue = 1)
public class Economia extends Model {

	/**
	 * 
	 */
	private static final long serialVersionUID = -9036826261359761197L;

	@Id
	@GeneratedValue(generator = "SEQ_ECONOMIA", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID")
	private Long id;

	@Column(name = "INSCRICAO")
	private Long inscricao;

	@Column(name = "COD_TARIFA")
	private Long codTarifa;

	@Column(name = "ECONOMIAS")
	private Integer qtdEconomias;

	@ManyToOne
	@JoinColumn(name = "ID_CARGA", referencedColumnName = "ID")
	private Carga carga;

	public Economia() {
		super();
	}

	public Economia(Long id, Long inscricao, Long codTarifa,
			Integer qtdEconomias) {
		super();
		this.id = id;
		this.inscricao = inscricao;
		this.codTarifa = codTarifa;
		this.qtdEconomias = qtdEconomias;
	}

	public Economia(Long id, Long inscricao, Long codTarifa,
			Integer qtdEconomias, Carga carga) {
		super();
		this.id = id;
		this.inscricao = inscricao;
		this.codTarifa = codTarifa;
		this.qtdEconomias = qtdEconomias;
		this.carga = carga;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the inscricao
	 */
	public Long getInscricao() {
		return inscricao;
	}

	/**
	 * @param inscricao
	 *            the inscricao to set
	 */
	public void setInscricao(Long inscricao) {
		this.inscricao = inscricao;
	}

	/**
	 * @return the codTarifa
	 */
	public Long getCodTarifa() {
		return codTarifa;
	}

	/**
	 * @param codTarifa
	 *            the codTarifa to set
	 */
	public void setCodTarifa(Long codTarifa) {
		this.codTarifa = codTarifa;
	}

	/**
	 * @return the qtdEconomias
	 */
	public Integer getQtdEconomias() {
		return qtdEconomias;
	}

	/**
	 * @param qtdEconomias
	 *            the qtdEconomias to set
	 */
	public void setQtdEconomias(Integer qtdEconomias) {
		this.qtdEconomias = qtdEconomias;
	}

	/**
	 * @return the carga
	 */
	public Carga getCarga() {
		return carga;
	}

	/**
	 * @param carga
	 *            the carga to set
	 */
	public void setCarga(Carga carga) {
		this.carga = carga;
	}

}
